package com.lib.krismile.weight;

/*
 * @author ： wangJiaWei
 * @date : 2021/3/29
 * @description ：
 */

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.lib.krismile.R;
import com.lib.krismile.util.DensityUtils;

public class ActionSafeView extends LinearLayout {
    private Context context;

    public ActionSafeView(Context context) {
        this(context, null);
        this.context = context;

    }

    public ActionSafeView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
        this.context = context;
    }

    public ActionSafeView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
        initView();
    }

    private void initView() {
        View inflate = LayoutInflater.from(getContext()).inflate(R.layout.cp_layout_header_safe, null, false);
        View statusBarView = inflate.findViewById(R.id.status_bar_view);
        ViewGroup.LayoutParams layoutParams = statusBarView.getLayoutParams();
        layoutParams.height = DensityUtils.getStatusBarHeight(context);
        statusBarView.setLayoutParams(layoutParams);
        addView(inflate);
    }
}
